<% content_for :left_sidebar do  %>
  <%= render :partial => "layouts/sidebar/xiwenguanli" %>
<% end %>
<%- model_class = TopNews -%>
<div class="page-header">
  <h1>大图新闻<h1>
</div>
<table class="table table-striped">
  <thead>
    <tr>
      <th>ID</th>
      <th>名字</th>
      <th>新闻链接</th>
      <th>状态</th>
      <th>操作</th>
    </tr>
  </thead>
  <tbody>
    <% @top_news.each do |top_news| %>
      <tr>
        <td><%= link_to top_news.id, admins_top_news_path(top_news) %></td>
        <td><%= raw top_news.title[0..30] %></td>
        <td><a href="<%= top_news.link_url %>" target="_blank"><%= top_news.link_url[0..30] %></a></td>
        <td><%= status_string top_news.status %></td>
        <td>
          <a class="btn btn-default btn-xs" href="/admins/top_news/<%= top_news.id %>/edit"><span class="translation_missing" title="translation missing: zh-CN.helpers.links.edit">编辑</span></a>
          <a class="btn btn-xs btn-danger" data-confirm="Are you sure?" data-method="delete" href="/admins/top_news/<%= top_news.id %>" rel="nofollow"><span class="translation_missing" title="translation missing: zh-CN.helpers.links.destroy">删除</span></a>
        </td>
      </tr>
    <% end %>
  </tbody>
</table>

<a class="btn btn-primary" href="/admins/top_news/new"><span class="translation_missing" title="translation missing: zh-CN.helpers.links.new">新增</span></a>